﻿$.fn.scrollTo = function (targetElementID) {
    var e = $(targetElementID);
    var offset = e.offset();

    // Note: below code compensates for fixed header
    $("html, body").animate({
        scrollTop: offset.top - 50,
        scrollLeft: offset.left,
        easing: "swing"
    });
}


$(document).ready(function () {
    $(document.body).hide();

    // Set page header/nav buttons fixed at top
    $("#nav").sticky();

    // Setup side bar nav links
    $("#WhoLink").click(function (event) { $(this).scrollTo("#HeadWho"); });
    $("#LocLink").click(function (event) { $(this).scrollTo("#HeadLoc"); });

    $(document.body).fadeIn(500);
});